
********************************************************************************
*                There's More to Marriage than Love:  
*          The Effect of Legal Status and Cultural Distance 
*                 on Intermarriages and Separations
*                   J Adda, G Tura and P Pinotti
********************************************************************************

clear all
set more 1
set more off


* Setting roots
cd ""  
global root             ""
global codes   	     	"$root\codes"
global data             "$root\data"
global log              "$root\log"
global output           "$root\output"
global graph            "$root\graph"
global migranti         "$data\migranti"
global mat              "$data\matrimoni"
global sep              "$data\separazioni"
global nati             "$data\nati"
global popolazione      "$data\popolazione"
global c1991            "$data\census 1991"
global c2001            "$data\census 2001"
global c2011            "$data\census 2011"


*  Marriage data 
do "$codes\data_matrimoni.do"  
do "$codes\M_dataset.do" 


*  Population data: immigrant population and total population
do "$codes\data_popolazione.do" 


*  Census data 1991, 2001 and 2011: M and F Singles and Cohabitations 
do "$codes\census1991.do" 
do "$codes\census2001.do" 
do "$codes\census2011.do" 
do "$codes\census_merge_1991-2001.do" 
do "$codes\census_merge_2001-2011.do" 


*  Amnesty 2002 data:  M and F Singles - irregulars
do "$codes\irregulars_amnesty2002.do"           
do "$codes\summary_stats_amnesty.do"           


*  Gains to marriage: descriptives and main estimates 
do "$codes\create_gains_marriage.do"  
do "$codes\create_gains_cohabitation.do"  
do "$codes\descriptive_evidence_gains.do"                                       
do "$codes\estimates_reducedform.do"   
                       
					   
*   Preliminary figures: Immigrants and Intermarriages
do "$codes\preliminary_figures.do"                                                     

*  ISMU data 
do "$codes\data_ismu.do"
do "$codes\estimates_ismu.do"


*  Robustness:
*  Measurement errors on irregular immigrants
do "$codes\robust_irregulars_measurementerror.do"
* Cultural distance based on EVS and WVS
do "$codes\create_culturaldistance.do"  
do "$codes\estimates_culturaldistance.do" 
*  Local labor markets
do "$codes\local_labor_markets.do"
do "$codes\estimates_local_markets.do"


*  Separation data: create data, descriptives and main estimates
do "$codes\data_separazioni.do" 
do "$codes\MS_merge.do"
do "$codes\estimates_separationrate_policychange.do" 


*  Summary stats: Marriages, Separations and Singles 
do "$codes\summary_stats.do"  


*  Fertility data: create data, descriptives and main estimates
do "$codes\data_nati.do"
do "$codes\N_dataset.do"
do "$codes\MSN_merge.do"
do "$codes\estimates_fertilityrate.do"



* Structural model:
* Vector of single males and females 
do "$codes\census2001_maritaldistribution.do"
do "$codes\census2011_maritaldistribution.do"

* Marital distribution
do "$codes\maritaldistribution.do"

* Derive homeownership from Census data
do "$codes\census2001_homeownership.do" 
do "$codes\census2011_homeownership.do" 

* Separation moments 
do "$codes\separation_moments_structuralmodel.do"





